
<%@ page
	import="java.text.DateFormat, java.text.SimpleDateFormat,java.util.Calendar,java.util.Date"%>
<%@ page
	import="org.json.JSONArray, org.json.JSONException,org.json.JSONObject"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/styles/layout.css" type="text/css" />
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<style>
		.control-label {display:inline-block; width:250px;}
		.control-group {padding-bottom:10px;}
	</style>
	<script>
	function getLocation() {

		if (navigator.geolocation) {
			navigator.geolocation.getCurrentPosition(showPosition, showError);
		} else {
			x.innerHTML = "Geolocation is not supported by this browser.";
		}
	}
	

	function showPosition(position) {

		var lat = document.getElementById('lat').value = position.coords.latitude;
		document.getElementById('longi').value = position.coords.longitude;
		if(lat > 0)
		{
			
			document.getElementById("registration").disabled = false;
			document.getElementById("registration").className = "";
			document.getElementById("registration").className = "myButton";
		}

	}

	function showError(error) {
		switch (error.code) {
		case error.PERMISSION_DENIED:
			x.innerHTML = "User denied the request for Geolocation."
			break;
		case error.POSITION_UNAVAILABLE:
			x.innerHTML = "Location information is unavailable."
			break;
		case error.TIMEOUT:
			x.innerHTML = "The request to get user location timed out."
			break;
		case error.UNKNOWN_ERROR:
			x.innerHTML = "An unknown error occurred."
			break;
		}
	}
</script>
	<script src="<%=request.getContextPath()%>/js/validation.js"></script>
</head>
<body onload="getLocation()">

	<%@include file="header.jsp"%>

	<div class="wrapper col3">
		<%
			String mnum = (String) session.getAttribute("mob");
			String name = (String) session.getAttribute("name");
			String email = (String) session.getAttribute("email");
		%>
		<form action="../RegistrationController" method="post"
			enctype="multipart/form-data" autocomplete="off">
			<div id="intro">


				<div class="fl_left1">
					
						<div id="login">
<fieldset><legend>Registration Form</legend>						
<div class="control-group">
<label class="control-label">Mobile No.:</label>
	<%=mnum %>	
</div>
<div class="control-group">
<label class="control-label">Name:</label>
	<%=name %>	
</div>
<div class="control-group">
<label class="control-label">Email:</label>
	<%=email %>	
</div>
<div class="control-group">
<label class="control-label" for="password">Password:</label>

	<input type="password" name="password" id="password" maxlength="20" class="required password" />
	<span style="display: none;" class="help-inline">Please enter valid password.</span>
	
</div>
<div class="control-group">
<label class="control-label" for="confirmpassword">Confirm Password:</label>

	<input type="password" name="confirmpassword" id="confirmpassword" maxlength="20" class="required password" />
	<span style="display: none;" class="help-inline">Passwords do not match</span>	
</div>		
<div class="control-group">
<label class="control-label" for="fileName">Profile Image:</label>
	<input id="fileName" type="file" name="fileName" size="30" />
	<span style="display: none;" class="help-inline">Select only image</span>	
</div>			
<div class="control-group">
<label class="control-label" for="q1">Security Question 1:</label>
	<select name="q1" id="q1" class="idea0">
											<option>What is your nickname?</option>
											<option>where is your home-town?</option>
											<option>Which is your favourite food?</option>
									</select>
	<span style="display: none;" class="help-inline">Please select security question</span>	
</div>	
<div class="control-group">
<label class="control-label" for="a1">Security Answer 1:</label>
	<input type="text" name="a1" id="a1"  class="required"/>
	<span style="display: none;" class="help-inline">Please select security answer</span>	
</div>		
<div class="control-group">
<label class="control-label" for="q2">Security Question 2:</label>
	<select name="q2" id="q2">

											<option>What is your grandfather name?</option>
											<option>which is your favourite movie?</option>
											<option>Which sport do you like?</option>

									</select>
	<span style="display: none;" class="help-inline">Please select security question</span>	
</div>	
<div class="control-group">
<label class="control-label" for="a2">Security Answer 2:</label>
	<input type="text" name="a2" id="a2" class="required"/>
	<span style="display: none;" class="help-inline">Please select security answer</span>	
</div>	
<div class="control-group">
<label class="control-label" for="q3">Security Question 3:</label>
	<select name="q3" id="q3">

											<option>What is your best friend name?</option>
											<option>Which is your favourite place?</option>
											<option>What is your first school name?</option>
									</select>
	<span style="display: none;" class="help-inline">Please select security question</span>	
</div>	
<div class="control-group">
<label class="control-label" for="a2">Security Answer 3:</label>
	<input type="text" name="a3" id="a3" class="required"/>
	<span style="display: none;" class="help-inline">Please select security answer</span>	
</div>	
<div class="control-group">
<label class="control-label" for="a2">Register As:</label>
	<select name="type" id="type" style="width: 113px;">
											<option value="-1" selected="selected">-- Select --</option>
											<option>customer</option>
											<option>merchant</option>
									</select>
	<span style="display: none;" class="help-inline">Please select registration type</span>	
</div>	
<input type="hidden" name="lat" id="lat" />
<input type="hidden" name="longi" id="longi" />						
<!-- <input type="text" name="callto" id="callto" value="registration" /> -->

						<div class="fl_right">

							<input type="submit" class="mydisabledButton" name="registration"
								id="registration" value="Submit" />
								<input type="hidden" name="callto" id="callto"  value="registration"/>
						</div>
</fieldset>						

</div>


				</div>
			</div>
		</form>
	</div>


	<%@include file="footer.jsp"%>
</body>
</html>
